<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      input {
        height: 30px;
        border: 1px solid #eee;
        outline: 0;
      }
    </style>
  </head>
  <body>
    <input type="text" value="提交" />
    <script>
      var inp = document.querySelector("input");
      inp.onfocus = function () {
        inp.value = "";
        inp.style.borderColor = "pink";
      };
      inp.onblur = function () {
        if (inp.value == "") {
          inp.value = "提交";
          inp.style.borderColor = "#eee";
        }else {
          inp.style.borderColor = "#eee";

        }
      };
    </script>
  </body>
</html>
